package com.momo.hr.bean;

/**
 * 响应状态的实体类,这里修改了set方法
 */
public class RespBean {
    //状态
    private Integer status;

    private String msg;

    private Object obj;

    public RespBean() {
    }

    public static RespBean build(){
        return new RespBean();
    }


    public RespBean(Integer status, String msg, Object obj) {
        this.status = status;
        this.msg = msg;
        this.obj = obj;
    }

    public RespBean(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }


    /**
     * 参数状态的方法
     * @param msg
     * @return
     */
    public static RespBean ok(String msg){
        return new RespBean(200,msg);
    }
    public static RespBean error(String msg){
        return new RespBean(500, msg);
    }
    public static RespBean error(String msg,Object obj){
        return new RespBean(500, msg,obj);
    }
    public static RespBean ok(String msg,Object obj){
        return new RespBean(200,msg,obj);
    }

    public Integer getStatus() {
        return status;
    }

        public RespBean setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public RespBean setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getObj() {
        return obj;
    }

    public RespBean setObj(Object obj) {
        this.obj = obj;
        return this;
    }


}
